﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templete.master" AutoEventWireup="true"

ValidateRequest="false" EnableViewState="false" EnableEventValidation="false" EnableViewStateMac="false"
    CodeFile="MobileList_Item.aspx.cs" Inherits="MobileList_Item" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
          $(document).ready(function () {

              /* setup navigation, content boxes, etc... */
              Administry.setup();
             
              /* progress bar animations - setting initial values */
	          Administry.progress("#progress1", 1, 6);
               
              // validate form on keyup and submit
              var validator = $("#aspnetForm").validate({
                
                  rules: {
                                  
                      <%# txtIMEI.UniqueID %>: "required"
                  },
                  messages: {
                       <%# txtIMEI.UniqueID %>: "设备编号不能为空"
                  },
                  // the errorPlacement has to take the layout into account
                  errorPlacement: function (error, element) {
                      error.insertAfter(element.parent().find('label:first'));
                  },
                  //specifying a submitHandler prevents the default submit, good for the demo
		        submitHandler: function(id) {
            alert("1");
                var data = { 
                    id: id,
                    imei: $('#<%# txtIMEI.ClientID %>').val(),
                    brand: $('#<%# txtBrand.ClientID %>').val(),
                    model: $('#<%# txtModel.ClientID %>').val(),
                    chkValid: $('#<%# chkValid.ClientID %>').val()
                    };

                 $.post("MobileList_Item.aspx",data,function(data){
                  if(data.result=="success"){
                    alert('修改成功');
                  }
                },"json"
                );
               
		    },

                
                  // set new class to error-labels to indicate valid fields
                  success: function (label) {
                      // set &nbsp; as text for IE
                      label.html("&nbsp;").addClass("ok");
                  }
              });

             

          });
    </script>
 
    <fieldset>
        <legend>设备信息维护</legend>
        <p>
            <asp:Literal ID="Literal2" runat="server" meta:resourcekey="DeviceInfo" />
            <asp:Literal ID="litInfo" runat="server"></asp:Literal>
        </p>
        <p>
            设备编号<label class="required" for=" <%# txtIMEI.UniqueID %>">:</label><br />
            <input type="text" runat="server" id="txtIMEI" class="half" value="" maxlength="20" />
        </p>
        <p>
            品牌<br />
            <input type="text" runat="server" id="txtBrand" class="half" value="" />
        </p>
        <p>
            <label>
                型号:</label><br />
            <asp:TextBox ID="txtModel" class="half" runat="server" MaxLength="18"></asp:TextBox>
        </p>
        <p>
            <input type="checkbox" id="chkValid" runat="server" checked />
            <label class="choice" for="chkValid">
                有效</label>
        </p>
    </fieldset>
    <p class="box">
        <asp:Button ID="btnSave" runat="server" class="btn btn-green" Text="提  交" OnClick="btnSave_Click" />
        <a runat="server" id="btnCancel" class="btn"><span class="icon icon-cancel">&nbsp;</span>清空</a>
    </p>
</asp:Content>
